# -*- coding: utf-8 -*-

"""
@Remark: 商城路由文件
"""
from django.urls import path, re_path
from rest_framework import routers
from apps.mall.views import GoodsManageViewSet,FinanceOrderInfoViewSet,GoodsOrderManageViewSet

system_url = routers.SimpleRouter()

system_url.register(r'goodsspu', GoodsManageViewSet)
system_url.register(r'goodsforderinfo', FinanceOrderInfoViewSet)
system_url.register(r'goodsorder', GoodsOrderManageViewSet,basename='goodsorder')

urlpatterns = [
    re_path('goodsspu/islaunched/(?P<pk>.*?)/', GoodsManageViewSet.as_view({'put':'islaunched'}), name='后台根据sku_id上下架商品'),
    path('goodsforderinfo/orderstatistics/',FinanceOrderInfoViewSet.as_view({'get':'orderstatistics'}), name='后台商品类订单金额统计'),
    path('goodsorder/orderstatistics/',GoodsOrderManageViewSet.as_view({'get':'orderstatistics'}), name='后台商品订单金额订单量统计'),
    path('goodsorder/status/',GoodsOrderManageViewSet.as_view({'post':'orderstatus'}), name='后台商品订单金额订单量统计'),
    path('goodsorder/refund/',GoodsOrderManageViewSet.as_view({'post':'ordersrefund'}), name='后台商品订单金额订单量统计'),
    
]
urlpatterns += system_url.urls